/*
 * Copyright (C) 2020 yixun All Rights Reserved.
 * 
 * CustomerDto.java
 */
package com.yixun.qfbao.model.dto;

import com.yixun.qfbao.model.Customer;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * [文件名称]<br>
 * CustomerDto.java<br>
 * <br>
 * [文件描述]<br>
 * 客户 数据辅助类<br>
 * <br>
 * [修改记录]<br>
 * 2020-09-08 11:33:45 创建 陶俊代码生成器<br>
 * 
 * @author 陶俊代码生成器
 * @version 1.00
 */
public class CustomerDto extends Customer {
	private static final long serialVersionUID = 1L;
	/**
	 *需要正序字段名
	 */
	private List<String> asc;
	/**
	 *需要逆序字段名
	 */
	private List<String> desc;
	/**
	 *排序SQL
	 */
	private String orders;
    
    /**
	 *  添加需要正序字段名
	 */
	public void addAsc(String col){
		if(asc==null){
			asc = new LinkedList<String>();
		}
		asc.add(col);
	}
	
	/**
	 *  清空需要正序字段名
	 */
	public void cleanAsc(){
		asc = null;
	}
	
	/**
	 *  添加需要逆序字段名
	 */
	public void addDesc(String col){
		if(desc==null){
			desc = new LinkedList<String>();
		}
		desc.add(col);
	}
	
	/**
	 *  清空需要逆序字段名
	 */
	public void cleanDesc(){
		desc = null;
	}
	
	/**
	 *  如果排序SQL为空根据需要正逆序的字段名拼接排序SQL
	 */
	public String  getOrders() {
		StringBuilder orderStr = null;
		StringBuilder ascStr;
		StringBuilder descStr;
		if(orders==null){
			if(asc!=null){
				ascStr = new StringBuilder();
				orderStr = new StringBuilder();
				String pex = "";
				for(String a : asc){
					ascStr.append(pex+a);
					pex = ",";
				}
				orderStr.append(ascStr.toString()+" ASC");
			}
			if(desc!=null){
				descStr = new StringBuilder();
				String pex = "";
				for(String d : desc){
					descStr.append(pex+d);
					pex = ",";
				}
				if(orderStr==null){
					orderStr = new StringBuilder();
					orderStr.append(descStr.toString()+" DESC");
				}else{
					orderStr.append(","+descStr.toString()+" DESC");
				}
			}
			orders = orderStr!=null?orderStr.toString():null;
		}
		
		return orders;
	}
	
	/**
	 *  设置排序SQL
	 */
	public void setOrders(String orders) {
		this.orders = orders;
	}
	private Date updateTimeBefore;
	private Date updateTimeAfter;
	private Date createTimeBefore;
	private Date createTimeAfter;
	private String searchContent;
	private String customerIds;

	@ApiModelProperty(value="性别-中文")
	private String genderCN;
	@ApiModelProperty(value="年龄范围-中文")
	private String ageRangeCN;
	@ApiModelProperty(value="总预算-中文")
	private String budgetCN;
	@ApiModelProperty(value="首付预算-中文")
	private String downBudgetCN;
	@ApiModelProperty(value="意向区域-中文")
	private String areaCN;
	@ApiModelProperty(value="户型-中文")
	private String[] houseTypeCN;
	@ApiModelProperty(value="楼层-中文")
	private String[] floorCN;
	@ApiModelProperty(value="装修-中文")
	private String decorationCN;
	@ApiModelProperty(value="物业类型-中文")
	private String[] propertyTypeCN;
	@ApiModelProperty(value="入住人数-中文")
	private String peopleCountCN;
	@ApiModelProperty(value="置业目的-中文")
	private String housePurposeCN;
	@ApiModelProperty(value="付款方式-中文")
	private String payMethodCN;

    public Date getUpdateTimeBefore() {
        return this.updateTimeBefore;
    }
    public void setUpdateTimeBefore(Date updateTimeBefore) {
        this.updateTimeBefore = updateTimeBefore;
    }

    public Date getUpdateTimeAfter() {
        return this.updateTimeAfter;
    }
    public void setUpdateTimeAfter(Date updateTimeAfter) {
        this.updateTimeAfter = updateTimeAfter;
    }
    public Date getCreateTimeBefore() {
        return this.createTimeBefore;
    }
    public void setCreateTimeBefore(Date createTimeBefore) {
        this.createTimeBefore = createTimeBefore;
    }

    public Date getCreateTimeAfter() {
        return this.createTimeAfter;
    }
    public void setCreateTimeAfter(Date createTimeAfter) {
        this.createTimeAfter = createTimeAfter;
    }

	public String getSearchContent() {
		return searchContent;
	}

	public void setSearchContent(String searchContent) {
		this.searchContent = searchContent;
	}

	public String getCustomerIds() {
		return customerIds;
	}

	public void setCustomerIds(String customerIds) {
		this.customerIds = customerIds;
	}

	public String getGenderCN() {
		return genderCN;
	}

	public void setGenderCN(String genderCN) {
		this.genderCN = genderCN;
	}

	public String getAgeRangeCN() {
		return ageRangeCN;
	}

	public void setAgeRangeCN(String ageRangeCN) {
		this.ageRangeCN = ageRangeCN;
	}

	public String getBudgetCN() {
		return budgetCN;
	}

	public void setBudgetCN(String budgetCN) {
		this.budgetCN = budgetCN;
	}

	public String getDownBudgetCN() {
		return downBudgetCN;
	}

	public void setDownBudgetCN(String downBudgetCN) {
		this.downBudgetCN = downBudgetCN;
	}

	public String getAreaCN() {
		return areaCN;
	}

	public void setAreaCN(String areaCN) {
		this.areaCN = areaCN;
	}

	public String[] getHouseTypeCN() {
		return houseTypeCN;
	}

	public void setHouseTypeCN(String[] houseTypeCN) {
		this.houseTypeCN = houseTypeCN;
	}

	public String[] getFloorCN() {
		return floorCN;
	}

	public void setFloorCN(String[] floorCN) {
		this.floorCN = floorCN;
	}

	public String getDecorationCN() {
		return decorationCN;
	}

	public void setDecorationCN(String decorationCN) {
		this.decorationCN = decorationCN;
	}

	public String[] getPropertyTypeCN() {
		return propertyTypeCN;
	}

	public void setPropertyTypeCN(String[] propertyTypeCN) {
		this.propertyTypeCN = propertyTypeCN;
	}

	public String getPeopleCountCN() {
		return peopleCountCN;
	}

	public void setPeopleCountCN(String peopleCountCN) {
		this.peopleCountCN = peopleCountCN;
	}

	public String getHousePurposeCN() {
		return housePurposeCN;
	}

	public void setHousePurposeCN(String housePurposeCN) {
		this.housePurposeCN = housePurposeCN;
	}

	public String getPayMethodCN() {
		return payMethodCN;
	}

	public void setPayMethodCN(String payMethodCN) {
		this.payMethodCN = payMethodCN;
	}
}
